{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Deques Overview\n",
    "\n",
    "A deque, also known as a double-ended queue, is an ordered collection of items similar to the queue. It has two ends, a front and a rear, and the items remain positioned in the collection. What makes a deque different is the unrestrictive nature of adding and removing items. New items can be added at either the front or the rear. Likewise, existing items can be removed from either end. In a sense, this hybrid linear structure provides all the capabilities of stacks and queues in a single data structure. \n",
    "\n",
    "It is important to note that even though the deque can assume many of the characteristics of stacks and queues, it does not require the LIFO and FIFO orderings that are enforced by those data structures. It is up to you to make consistent use of the addition and removal operations.\n",
    "\n",
    "Let's see an Image to visualize the Deque Data Structure:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAATQAAAD1CAYAAADeQgk6AAAAAXNSR0IArs4c6QAAAARnQU1BAACx\njwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAAGYktHRAD/AP8A/6C9p5MAAB7XSURBVHhe7d0J\nlBTV1QfwOwszDIMzrCIoIIiKAdTAETUH40IUI2riFhKTmBw1QUI+QRBZVEg8IC4QcQU0+aIRyYnR\nL4qgonjUSKLGLSdDgiKGVUD2Zfbpnvrq/+Y19Azdw3T3ne6q6v/vnD5U1fRM0a+rb7936y05jkuI\niAIg1/5LROR7DGhEFBgZb3KeddZ5UlHRxu6JhEI1UlNTKfn5BVJYWGyPNlZfLxLvf7169Qr3Z2xF\nE2WjjAe0QYPOkS5d3rF7qVu37hxZv17v7xGRf7DJSUSBEbiAlpPDGE2UrTyQQ7tUioqW2r3Ubd16\nqXz6qd7fIwqinJwcOeWUb9m9xtwfSW6cekFNTYWEQrVSWNhO8vML7VGR4uI6ee+9t+xe5jCgEWWh\n448/R/r00cs179x5jpSVZT53zfYZEQUGAxpRFgpqrpkBjSgLFRYeZbd0FBeX2q3M8kRAC4fL7ZaO\nAwcO2C0iyiaeCGiOE7Z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27UIgoPUKhKrulo6am2m4lL+GApnHSaNqFQkTZi01OIgoMBjQiSor2sEXHsRspSDigaZw0\nGsdyEvmT9uqToZDdSEHCAU3jpNG4JCcRaWGTk4gCgwGNiDxAJ/eUZEBj4osom5WUlNgtHXl5On8v\nx3HZ7RYZNeoXsnHjFGnbtpc9kppdu34hL700WXr37m2PEJHXbd68WXr27CmnnPIte6Qx3OzLjVNd\nqq4+IOFwyI0h7d1A1jDRRVXVfhk+/GxZuHCe2U9WwgFt9Ojx8sYb70pRUUNEDYfr3P9gufsfy3f/\ng0eZY03V18e/O7p69QrZtGmTHHfccfYIEVFyEg5oRERexZsCRBQYDGhEFBgMaEQUGAxoRBQYDGhE\nFBgMaEQUGAxoRBQYDGhEFBAi/w/W56D6Uw33tQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<IPython.core.display.Image object>"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from IPython.display import Image\n",
    "Image('http://www.codeproject.com/KB/recipes/669131/deque.png')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Note how we can both add and remove from the front and the back of the Deque. In the next lecture, we will implement our own Deque class!"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
